#ifndef METAFILESYSTEM_H
#define METAFILESYSTEM_H

#include "fs.h"

typedef struct
{
    u32 current;
    System *fileSystems;
    u32 numfs;
    char *currentDirectory;
} MetaFileSystem;

void mfs_init();
void mfs_free();
void mfs_showFS();
void mfs_mount(const char *prefix, FSType type, System *system);
void mfs_umount(const char *prefix);
char *mfs_getRealPath(const char *inpath);
s32 mfs_openFile(const char *ofilename, FileAccess access);
u32 mfs_getNewHandle();
u32 mfs_getHandle();
FileInfo mfs_getFileInfo(const char *filename);
u32 mfs_readFile(u32 handle, char *ptr, u32 size);
u32 mfs_readFileToAddr(u32 handle, u32 address, u32 size);
void mfs_closeFile(u32 handle);
s32 mfs_seekFile(u32 handle, s32 position, FileMove type);
u32 mfs_getDirListing(const char *path, FileInfo **listing);
void mfs_freeDirListing(const char *path, FileInfo *listing);
void mfs_chdir(const char *dir);
s32 mfs_writeFile(u32 handle, u8 *pointer, u32 size);
s32 mfs_writeFileFromAddr(u32 handle, u32 address, u32 size);
s8 mfs_mkdir(const char *dir, s32 mode);

#endif

